package com.xiaotu.mapper;

import com.xiaotu.vo.BattlePlayerInfoVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author zhangxiao
 * @create 2022-04-01 18:04
 */
@Mapper
public interface BattlePlayerInfoMapper {

    @Select("<script>" +
            " SELECT " +
            " t1.player_id, " +
            " t1.player_name, " +
            " t1.`level`, " +
            " t2.image_url, " +
            " t3.props_card_num,  " +
            " t3.calculate, " +
            " t3.gold_coins, " +
            " t1.phone " +
            "FROM " +
            " tab_player t1 " +
            " LEFT JOIN tab_player_image t2 ON t1.image_id = t2.image_id " +
            " LEFT JOIN tab_player_equipment t3 ON t1.player_id = t3.player_id  " +
            "WHERE " +
            " t1.player_id IN ( " +
            " <foreach collection='list' item='v' separator=','> " +
            " #{v} " +
            " </foreach> " +
            " ) " +
            "</script>")
    List<BattlePlayerInfoVo> getBattlePlayerInfo(@Param("list") List<Integer> playerIds);
}
